MIC = 

SCHEDULER_INSTALL_PATH=${DAG_HOME}
CXX=g++ #icc
CC = gcc #icpc

DEBUG = -DCHECK -g
OPT= -O3
EXTRA_FLAGS= -DN=1026
CFLAGS =$(DEBUG) $(OPT) $(EXTRA_FLAGS)  -Wall -I${SCHEDULER_INSTALL_PATH}/include
LFLAGS=-L${SCHEDULER_INSTALL_PATH}/lib -ldag_task_scheduler -lpthread -lstdc++ -lrt -ltbb

ifeq ($(MIC),TRUE)
CXX = icc -mmic
CC = icpc -mmic
FC = ifort -mmic
LFLAGS= -L/opt/intel/tbb42/lib/mic/ -L/opt/mpss/3.1.2/sysroots/k1om-mpss-linux/lib64/ -L/opt/mpss/3.1.2/sysroots/k1om-mpss-linux/lib64/ -L${SCHEDULER_INSTALL_PATH}/lib -ldag_task_scheduler -lpthread -ltbb  -lrt
endif


all:dag omp ori
dag: gauss_dag.c
	$(CXX) $(CFLAGS) -o gauss_dag gauss_dag.c $(LFLAGS) 

omp:gauss_omp.c
	$(CXX) $(DEBUG) $(OPT) $(EXTRA_FLAGS)  -Wall -fopenmp -o gauss_omp gauss_omp.c 

ori:gauss_ori.c
	$(CXX) $(DEBUG) $(OPT) $(EXTRA_FLAGS)  -Wall -o gauss_ori gauss_ori.c 

clean:
	@rm -f *.o  gauss_dag  gauss_omp gauss_ori tmp
	@echo Cleaning current directory 
clean_all:
	@rm -f -r *.o  data  tmp  gauss_dag gauss_omp gauss_ori
	@echo Cleaning current directory